#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
using ll = long long;
const int N = 100010;
int a[N], b[N];
ll tr[N];
int n, m;
int lowbit(int x)
{
    return x & -x;
}
void add(int xi, int v)
{
    for (int i = xi; i < N; i += lowbit(i)) tr[i] += v;
}
ll query(int xi)
{
    ll res = 0;
    for (int i = xi; i; i -= lowbit(i)) res += tr[i];
    return res;
}
int main()
{
    ios::sync_with_stdio(false); cin.tie(nullptr);
    cin >> n >> m;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        b[i] = a[i] - a[i - 1];
        add(i, b[i]);
    }
    while (m--)
    {
        char op[2] = { 0 };
        int l, r, x;
        cin >> op;
        if (*op == 'Q')
        {
            cin >> x;
            cout << query(x) << endl;
        }
        else
        {
            cin >> l >> r >> x;
            add(l, x), add(r + 1, -x);
        }
    }
    return 0;
}